
const List = props => {
    console.log(props)

    function click(e) {
        // console.dir(e.target.parentNode.className)
        props.a1(e.target.parentNode.className)
    }

    return (
        <fieldset>
            <h1>正在进行</h1>
            <div className="doing">
                {
                    props.todo.map((item, index) => {
                        return <p key={index} className={index}><button onClick={click} >点击完成</button>&nbsp;{item} &nbsp;<button>删除</button></p>
                    })
                }
            </div>
            <h1>已经完成</h1>
            <div className="done">
                {
                    props.done.map((it, index) => {
                        return (<p key={index} className={index}><button>点击完成</button>&nbsp;{it} &nbsp;<button>删除</button></p>)
                    })
                }
            </div>
        </fieldset>
    )
}
export default List